package com.ggggeeennn.studentUser.service.Impl;

import com.ggggeeennn.exam.domain.ExamManage;
import com.ggggeeennn.question.domain.Question;
import com.ggggeeennn.studentUser.domain.DO.ExerciseQuery;
import com.ggggeeennn.studentUser.mapper.ExerciseMapper;
import com.ggggeeennn.studentUser.service.ExerciseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;


@Service
public class ExerciseServiceImpl implements ExerciseService {

    @Autowired
    private ExerciseMapper exerciseMapper;
    @Override
    public List<Question> getExerciseList(ExerciseQuery exerciseQuery) {

        //这里没用处理章节chapters

        //查询判断题集合
        List<Question> judgeQuestions=exerciseMapper.getJudgeQuestions(exerciseQuery);
        //查询选择题集合
        List<Question> multiQuestions=exerciseMapper.getMultiQuestions(exerciseQuery);
        //查询填空题集合
        List<Question> fillQuestions=exerciseMapper.getFillQuestions(exerciseQuery);
        //合成
        List<Question> questions=new ArrayList<>();
        questions.addAll(judgeQuestions);
        questions.addAll(multiQuestions);
        questions.addAll(fillQuestions);
        return questions;

    }
}
